.quick-search {
    position: relative;
    max-width: 360px;
    flex-grow: 1;
    z-index: 5;

    @media screen and (max-width: 1150px) {
        display: none;
    }
}

.quick-search:active,
.quick-search:focus-within {
    box-shadow: var(--quick-search-box-shadow);
    border-radius: var(--quick-search-border-radius);
}

.quick-search__inputs {
    display: flex;
    /* Ordered backwards for better keyboard navigation */
    flex-direction: row-reverse;
    align-items: stretch;
    gap: 2px;
    background-color: var(--quick-search-bg);
    border-radius: var(--quick-search-border-radius);
    overflow: hidden;
    border: var(--quick-search-border);
    height: 100%;
}

.quick-search:active .quick-search__inputs,
.quick-search:focus-within .quick-search__inputs {
    border-radius: var(--quick-search-border-radius) var(--quick-search-border-radius) 0 0;
    border-bottom: 1px solid transparent;
}

.quick-search__input {
    width: 100%;
    background-color: inherit;
    border: none;
    font-size: 13px;
    padding: 1px 0 1px 8px;
    color: var(--quick-search-fg);
}

.quick-search__input::placeholder {
    text-transform: capitalize;
}

.quick-search__input:focus {
    outline: none;
}

.quick-search:not(:focus-within):not(:active) .quick-search__results {
    display: none;
}

.quick-search__radios {
    display: flex;
    align-items: stretch;
    background-color: inherit;
    cursor: pointer;
    width: min-content;
}

.quick-search__radio-label {
    cursor: pointer;
    color: var(--quick-search-selector-fg);
    display: flex;
}

.quick-search__radio-label:hover,
.quick-search__radio-label:focus-within {
    color: var(--quick-search-selector-hover-fg);
}

.quick-search__radio-icon {
    height: 100%;
}

.quick-search__radio-icon:before {
    display: block;
    height: 100%;
    width: 32px;
    padding: 8px 0;
    text-align: center;
    font-size: 14px;
}

.quick-search__radio-icon:hover,
.quick-search__radio-label:focus-within .quick-search__radio-icon {
    background-color: var(--quick-search-selector-hover-bg);
}

.quick-search__radio:checked ~ .quick-search__radio-icon:before {
    background-color: var(--quick-search-selector-selected-bg);
    color: var(--quick-search-selector-selected-fg);
}

.quick-search__radio {
    position: absolute !important;
    opacity: 0;
    width: 0 !important;
    height: 0 !important;

    &::after {
        width: 0 !important;
        height: 0 !important;
    }
}

.quick-search__results {
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    border-radius: 0 0 var(--quick-search-border-radius) var(--quick-search-border-radius);
    border-bottom: var(--quick-search-border);
    border-left: var(--quick-search-border);
    border-right: var(--quick-search-border);
    box-shadow: var(--quick-search-box-shadow);
    max-height: 80vh;
    overflow-y: auto;
}

.quick-search__result {
    border-top: var(--quick-search-result-border);
}

.quick-search__result-link,
.quick-search__result--empty,
.quick-search__result--keep-typing {
    display: flex;
    background-color: var(--quick-search-bg);
    text-decoration: none;
    color: var(--quick-search-fg);
    font-size: 12px;
}

.quick-search__result-link {
    padding: 12px;
}

.quick-search__result--empty,
.quick-search__result--keep-typing {
    padding: 0;
}

.quick-search__result-link:hover,
.quick-search__result-link:focus {
    background-color: var(--quick-search-result-hover-bg);
}

.quick-search__image {
    /* TMDb posters should always be a ratio of 1.5 */
    width: 40px;
    height: 60px;
    border-radius: var(--quick-search-result-image-border-radius);
}

.quick-search__result-text {
    margin: 0;
    padding: 5px 10px;
    display: grid;
    align-items: center;
    font-size: 13px;
}

.quick-search__result-year {
    color: var(--quick-search-result-year-fg);
    font-size: 13px;
}
